$(document).ready(function() {
    FB.init({ appId: 133099936839937 });

    FB.getLoginStatus(function(response) {
        if (response.status === 'connected') {
            // the user is logged in and has authenticated your
            // app, and response.authResponse supplies
            // the user's ID, a valid access token, a signed
            // request, and the time the access token 
            // and signed request each expire
            var uid = response.authResponse.userID;
            var accessToken = response.authResponse.accessToken;
        } else if (response.status === 'not_authorized') {
            // the user is logged in to Facebook, 
            // but has not authenticated your app
        } else {
            // the user isn't logged in to Facebook.
        }
    });
});
            
function login() {
    FB.login(function (response) {
        if (response.authResponse) {
            alert(response.authResponse.userID);
            FB.api('/me', function (info) {
                alert(info.name);
                alert(info.email);
            });

        } else {
            alert('You have cancelled');
        }
    }, { scope: 'email,user_about_me' });
}